<%@ page language="java" contentType="text/html; charset=UTF-8"
    pageEncoding="UTF-8"%>
<%@taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core" %> 
<%@taglib prefix="fmt" uri="http://java.sun.com/jsp/jstl/fmt"%>
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
<meta name="viewport" content="width=device-width,minimum-scale=1.0,maximum-scale=1.0,user-scalable=no" />
<meta name="viewport" content="width=device-width, initial-scale=1.0" />
<link rel="stylesheet" href="${host_url}/css/app/common_1.css">
<link rel="stylesheet"  href="${host_url}/css/app/dropload.css">

<script type="text/javascript" src="${host_url}/js/app/jquery.min.js"></script>
<script src="${host_url}/js/app/dropload.min.js"></script>
<link rel="stylesheet"  href="${host_url}/css/app/getting-started.css">
<title></title>
<script type="text/javascript">	
function fn_courseDetail(id){
	window.webkit.messageHandlers.ios_open_page.postMessage('WKViewController:::url->${courseDetail_url}?id='+id+':::isRefresh->YES:::webTitle->课程详情');
}
</script>
</head>
<body>
	<div class="main">
		<div class="list" id="clist">
			<div id="c_content">
				<c:import url="/v2/college/courseItem?page_index=1"></c:import>
			</div>
		</div>
	</div>
	
	<script type="text/javascript">
	/*  页数 */
	var page_index = 2;
    /* dropload 加载分页 */
    loadPagination("clist",page_index);
	function loadPagination(div_id, page){
		$('#'+div_id).dropload({
	        scrollArea : window,
	        loadDownFn : function(me){
	            $.ajax({
	                type: 'get',
	                url: 'courseItem?page_index='+page+'&first_cat_id=${first_cat_id}',
	                dataType: 'text',
	                beforeSend: function(request) {
	    				request.setRequestHeader("AUTHORIZATION","${token}");
	    				request.setRequestHeader("SECRET","${memberId}");
	    				request.setRequestHeader("OS","${os}");
	    				request.setRequestHeader("PAGE","${page}");
	    			 }, 
	                contentType:"application/x-www-form-urlencoded; charset=UTF-8",
	                success: function(msg){
	                    if($.trim(msg)){
	                		page++;
	                    	$("#c_content").append(msg);
	                    	me.resetload();
	                   	/*  如果没有数据 */
	                    } else{
	                        	/*  锁定 */
	                        me.lock();
	                        	/*  无数据 */
	                        me.noData();
		                    /* $("#"+div_id+" .dropload-load").parent().remove(); */
	                    } 
	                },
		                error: function(xhr, type){
	                    	/*  即使加载出错，也得重置 */
	                    me.resetload();
	                } 
	            });
	        }
	    });
	}  
	$(function(){
		
	    <c:if test="${'ios'==os}">
	    window.webkit.messageHandlers.ios_show_close.postMessage('');
	    </c:if> 
	});
	</script>
</body>
</html>